[gd_scene load_steps=43 format=2]

[ext_resource path="res://src/shop_map.gd" type="Script" id=1]
[ext_resource path="res://src/player.gd" type="Script" id=2]
[ext_resource path="res://fonts/BubblegumSans-Regular.otf" type="DynamicFontData" id=3]
[ext_resource path="res://2d/price_input_number.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/npc_catalog.gd" type="Script" id=5]
[ext_resource path="res://shop.gd" type="Script" id=6]
[ext_resource path="res://src/npcs.gd" type="Script" id=7]
[ext_resource path="res://src/npc.gd" type="Script" id=8]
[ext_resource path="res://2d/player.png" type="Texture" id=9]
[ext_resource path="res://src/seat.gd" type="Script" id=10]
[ext_resource path="res://2d/seat_menu.gd" type="Script" id=11]
[ext_resource path="res://2d/talk.gd" type="Script" id=12]
[ext_resource path="res://2d/sale_window.gd" type="Script" id=13]
[ext_resource path="res://src/inventory.gd" type="Script" id=14]
[ext_resource path="res://2d/date.gd" type="Script" id=15]
[ext_resource path="res://2d/clock.png" type="Texture" id=16]
[ext_resource path="res://2d/arrow.png" type="Texture" id=17]
[ext_resource path="res://2d/speaker_portrait.gd" type="Script" id=18]
[ext_resource path="res://src/item_spot.gd" type="Script" id=19]
[ext_resource path="res://src/item_catalog.gd" type="Script" id=20]

[sub_resource type="CapsuleShape" id=1]
radius = 0.2
height = 0.4

[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ ExtResource( 9 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]

[sub_resource type="CubeMesh" id=3]
size = Vector3( 0.25, 1, 1 )

[sub_resource type="BoxShape" id=4]
extents = Vector3( 0.125, 0.5, 0.5 )

[sub_resource type="CubeMesh" id=5]
size = Vector3( 0.05, 1, 1 )

[sub_resource type="BoxShape" id=6]
extents = Vector3( 0.05, 0.5, 0.5 )

[sub_resource type="CubeMesh" id=7]
size = Vector3( 1, 0.4, 1 )

[sub_resource type="BoxShape" id=8]
extents = Vector3( 0.5, 0.2, 0.5 )

[sub_resource type="CubeMesh" id=9]
size = Vector3( 1, 0.4, 1 )

[sub_resource type="CubeMesh" id=10]
size = Vector3( 0.4, 0.4, 0.4 )

[sub_resource type="BoxShape" id=11]
extents = Vector3( 0.5, 1, 0.5 )

[sub_resource type="CubeMesh" id=12]
size = Vector3( 1, 0.01, 1 )

[sub_resource type="SpriteFrames" id=13]
animations = [ {
"frames": [  ],
"loop": true,
"name": "default",
"speed": 5.0
} ]

[sub_resource type="DynamicFont" id=14]
size = 24
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=15]
size = 20
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="Animation" id=16]
length = 0.383333
step = 0.0166667
tracks/0/type = "value"
tracks/0/path = NodePath(".:rect_scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.333333 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 1e-05, 1e-05 ), Vector2( 1.1, 1.1 ), Vector2( 1, 1 ) ]
}

[sub_resource type="DynamicFont" id=17]
size = 24
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=18]
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=19]
size = 42
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="Animation" id=20]
length = 0.21
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath("VBoxContainer:rect_scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.14, 0.2 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 1e-05, 1e-05 ), Vector2( 1.1, 1.1 ), Vector2( 1, 1 ) ]
}

[sub_resource type="DynamicFont" id=21]
use_filter = true
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=22]
size = 24
use_filter = true
font_data = ExtResource( 3 )

[node name="root" type="Spatial"]
script = ExtResource( 6 )

[node name="player" type="Spatial" parent="."]
script = ExtResource( 2 )

[node name="body" type="KinematicBody" parent="player"]

[node name="CollisionShape" type="CollisionShape" parent="player/body"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 )
shape = SubResource( 1 )

[node name="Camera" type="Camera" parent="player/body"]
transform = Transform( 1, 0, 0, 0, 0.891062, 0.453882, 0, -0.453882, 0.891062, 0, 3.03052, 2.86538 )

[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="player/body"]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -0.3, 0, 0 )
centered = false
frames = SubResource( 2 )

[node name="RayCast" type="RayCast" parent="player/body"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.337851, 0 )
enabled = true
cast_to = Vector3( 0, 0, 1 )

[node name="map" type="Spatial" parent="."]
script = ExtResource( 1 )

[node name="prototypes" type="Spatial" parent="map"]

[node name="wall" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0 )
mesh = SubResource( 3 )
material/0 = null

[node name="StaticBody" type="StaticBody" parent="map/prototypes/wall"]

[node name="CollisionShape" type="CollisionShape" parent="map/prototypes/wall/StaticBody"]
shape = SubResource( 4 )

[node name="door" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0 )
mesh = SubResource( 5 )
material/0 = null

[node name="StaticBody" type="StaticBody" parent="map/prototypes/door"]

[node name="CollisionShape" type="CollisionShape" parent="map/prototypes/door/StaticBody"]
shape = SubResource( 6 )

[node name="door2" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0 )
mesh = SubResource( 5 )
material/0 = null

[node name="cubboard" type="MeshInstance" parent="map/prototypes" groups=[
"item_spot",
]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.2, 0 )
mesh = SubResource( 7 )
material/0 = null
script = ExtResource( 19 )

[node name="cubboard" type="StaticBody" parent="map/prototypes/cubboard"]

[node name="CollisionShape" type="CollisionShape" parent="map/prototypes/cubboard/cubboard"]
shape = SubResource( 8 )

[node name="item_spot" type="Spatial" parent="map/prototypes/cubboard"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.221286, 0 )

[node name="sprite" type="Sprite3D" parent="map/prototypes/cubboard/item_spot"]
transform = Transform( 0.2, 0, 0, 0, 0.188535, 0.0667416, 0, -0.0667416, 0.188535, 0, 0.145885, 0 )

[node name="counter" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.2, 0 )
mesh = SubResource( 9 )
material/0 = null

[node name="StaticBody" type="StaticBody" parent="map/prototypes/counter"]

[node name="CollisionShape" type="CollisionShape" parent="map/prototypes/counter/StaticBody"]
shape = SubResource( 8 )

[node name="chair" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.2, 0 )
mesh = SubResource( 10 )
material/0 = null
script = ExtResource( 10 )

[node name="on_enter" type="Area" parent="map/prototypes/chair"]

[node name="CollisionShape" type="CollisionShape" parent="map/prototypes/chair/on_enter"]
shape = SubResource( 11 )

[node name="floor" type="MeshInstance" parent="map/prototypes"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.005, 0 )
mesh = SubResource( 12 )
material/0 = null

[node name="item_placed" type="Spatial" parent="map/prototypes"]

[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="map/prototypes/item_placed"]
frames = SubResource( 13 )

[node name="Sprite3D" type="Sprite3D" parent="map/prototypes/item_placed"]

[node name="npcs" type="Spatial" parent="."]
script = ExtResource( 7 )

[node name="prototypes" type="Spatial" parent="npcs"]

[node name="npc" type="Spatial" parent="npcs/prototypes"]
script = ExtResource( 8 )

[node name="Sprite3D" type="Sprite3D" parent="npcs/prototypes/npc"]
centered = false
shaded = true

[node name="catalog" type="Node" parent="npcs/prototypes"]
script = ExtResource( 5 )

[node name="inventory" type="Node" parent="."]
script = ExtResource( 14 )

[node name="catalog" type="Node" parent="inventory"]
script = ExtResource( 20 )

[node name="ui" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="talk" type="Control" parent="ui"]
anchor_left = 0.2
anchor_top = 0.7
anchor_right = 0.8
anchor_bottom = 1.0
script = ExtResource( 12 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="speaker_sprite" type="TextureRect" parent="ui/talk"]
anchor_left = -0.335
anchor_top = -2.321
anchor_right = 0.179
anchor_bottom = 1.622
margin_left = 7.82402
margin_top = 116.78
margin_right = 0.0223923
margin_bottom = 0.039978
texture = ExtResource( 9 )
expand = true
stretch_mode = 5
script = ExtResource( 18 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="speaker_sprite_r" type="TextureRect" parent="ui/talk"]
anchor_left = 0.869
anchor_top = -1.667
anchor_right = 1.334
anchor_bottom = 1.556
margin_left = 0.0863647
margin_top = 0.0599976
margin_right = -0.60968
margin_bottom = -0.0799866
expand = true
stretch_mode = 5
script = ExtResource( 18 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Panel" type="Panel" parent="ui/talk"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer" type="VBoxContainer" parent="ui/talk/Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 15.0
margin_top = 15.0
margin_right = -15.0
margin_bottom = -15.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="speaker_name" type="Panel" parent="ui/talk/Panel/VBoxContainer"]
margin_right = 584.0
margin_bottom = 32.0
rect_min_size = Vector2( 0, 32 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="speaker_name" type="RichTextLabel" parent="ui/talk/Panel/VBoxContainer/speaker_name"]
anchor_right = 1.0
margin_right = -367.0
margin_bottom = 32.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/normal_font = SubResource( 14 )
text = "speaker name"
scroll_active = false
__meta__ = {
"_edit_use_anchors_": false
}

[node name="text" type="RichTextLabel" parent="ui/talk/Panel/VBoxContainer"]
margin_top = 36.0
margin_right = 584.0
margin_bottom = 150.0
size_flags_vertical = 3
custom_fonts/normal_font = SubResource( 15 )
text = "text"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="sale_window" type="Control" parent="ui"]
anchor_left = 0.344
anchor_top = 0.317
anchor_right = 0.656
anchor_bottom = 0.683
margin_left = -0.256012
margin_top = -0.199997
margin_right = 0.255981
margin_bottom = 0.199982
script = ExtResource( 13 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="AnimationPlayer" type="AnimationPlayer" parent="ui/sale_window"]
anims/open = SubResource( 16 )

[node name="VBoxContainer" type="VBoxContainer" parent="ui/sale_window"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Panel" type="Panel" parent="ui/sale_window/VBoxContainer"]
margin_right = 320.0
margin_bottom = 52.0
rect_min_size = Vector2( 0, 52 )

[node name="HBoxContainer" type="HBoxContainer" parent="ui/sale_window/VBoxContainer/Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = 10.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="item_icon" type="TextureRect" parent="ui/sale_window/VBoxContainer/Panel/HBoxContainer"]
margin_right = 32.0
margin_bottom = 42.0
rect_min_size = Vector2( 32, 32 )
expand = true
stretch_mode = 5
__meta__ = {
"_edit_use_anchors_": false
}

[node name="item_name" type="RichTextLabel" parent="ui/sale_window/VBoxContainer/Panel/HBoxContainer"]
margin_left = 36.0
margin_right = 310.0
margin_bottom = 42.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/normal_font = SubResource( 17 )
text = "Item Name"
scroll_active = false
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Panel2" type="Panel" parent="ui/sale_window/VBoxContainer"]
margin_top = 56.0
margin_right = 320.0
margin_bottom = 186.0
rect_min_size = Vector2( 0, 130 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="price_inputs" type="HBoxContainer" parent="ui/sale_window/VBoxContainer/Panel2"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 10.0
margin_bottom = -10.0
size_flags_horizontal = 5
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="price1" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 8.0
margin_right = 48.0

[node name="price2" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 52.0
margin_right = 92.0

[node name="price3" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 96.0
margin_right = 136.0

[node name="price4" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 140.0
margin_right = 180.0

[node name="price5" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]

[node name="price6" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 228.0
margin_right = 268.0

[node name="price7" parent="ui/sale_window/VBoxContainer/Panel2/price_inputs" instance=ExtResource( 4 )]
margin_left = 272.0
margin_right = 312.0

[node name="Panel3" type="Panel" parent="ui/sale_window/VBoxContainer"]
margin_top = 190.0
margin_right = 320.0
margin_bottom = 228.0
rect_min_size = Vector2( 0, 38 )
size_flags_vertical = 9
__meta__ = {
"_edit_use_anchors_": false
}

[node name="base_price" type="Label" parent="ui/sale_window/VBoxContainer/Panel3"]
margin_left = 10.0
margin_top = 10.0
margin_right = 40.0
margin_bottom = 40.0
size_flags_horizontal = 3
custom_fonts/font = SubResource( 18 )
text = "base 100 (100%)"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="seat_menu" type="Control" parent="ui"]
anchor_top = 1.0
anchor_bottom = 1.0
margin_top = -224.0
margin_right = 204.0
script = ExtResource( 11 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer" type="VBoxContainer" parent="ui/seat_menu"]
anchor_top = -0.0535714
anchor_right = 0.955882
anchor_bottom = 1.0
grow_vertical = 0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="open_shop" type="Button" parent="ui/seat_menu/VBoxContainer"]
margin_right = 195.0
margin_bottom = 56.0
custom_fonts/font = SubResource( 19 )
text = "Open shop"

[node name="open_shop2" type="Button" parent="ui/seat_menu/VBoxContainer"]
margin_top = 60.0
margin_right = 195.0
margin_bottom = 116.0
custom_fonts/font = SubResource( 19 )
text = "TODO"

[node name="open_shop3" type="Button" parent="ui/seat_menu/VBoxContainer"]
margin_top = 120.0
margin_right = 195.0
margin_bottom = 176.0
custom_fonts/font = SubResource( 19 )
text = "TODO"

[node name="close" type="Button" parent="ui/seat_menu/VBoxContainer"]
margin_top = 180.0
margin_right = 195.0
margin_bottom = 236.0
custom_fonts/font = SubResource( 19 )
text = "Close Menu"

[node name="AnimationPlayer" type="AnimationPlayer" parent="ui/seat_menu"]
anims/open = SubResource( 20 )

[node name="date" type="Panel" parent="ui"]
margin_left = 15.0
margin_top = 15.0
margin_right = 184.0
margin_bottom = 109.0
script = ExtResource( 15 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="HBoxContainer" type="HBoxContainer" parent="ui/date"]
margin_right = 40.0
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer" type="VBoxContainer" parent="ui/date/HBoxContainer"]
margin_right = 64.0
margin_bottom = 87.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="clock" type="TextureRect" parent="ui/date/HBoxContainer/VBoxContainer"]
margin_right = 64.0
margin_bottom = 64.0
rect_min_size = Vector2( 64, 64 )
texture = ExtResource( 16 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="arrow" type="TextureRect" parent="ui/date/HBoxContainer/VBoxContainer/clock"]
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
rect_pivot_offset = Vector2( 32, 32 )
texture = ExtResource( 17 )
expand = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="time" type="Label" parent="ui/date/HBoxContainer/VBoxContainer"]
margin_top = 68.0
margin_right = 64.0
margin_bottom = 87.0
custom_fonts/font = SubResource( 21 )
text = "Evening"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer2" type="VBoxContainer" parent="ui/date/HBoxContainer"]
margin_left = 68.0
margin_right = 136.0
margin_bottom = 87.0

[node name="location" type="Label" parent="ui/date/HBoxContainer/VBoxContainer2"]
margin_right = 68.0
margin_bottom = 19.0
custom_fonts/font = SubResource( 18 )
text = "Shop"

[node name="day" type="Label" parent="ui/date/HBoxContainer/VBoxContainer2"]
margin_top = 23.0
margin_right = 68.0
margin_bottom = 52.0
custom_fonts/font = SubResource( 22 )
text = "Day 23"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="money" type="Label" parent="ui/date/HBoxContainer/VBoxContainer2"]
margin_top = 56.0
margin_right = 68.0
margin_bottom = 75.0
custom_fonts/font = SubResource( 18 )
text = "$100"

[node name="debug" type="Control" parent="ui"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -247.0
margin_bottom = 160.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="HBoxContainer" type="HBoxContainer" parent="ui/debug"]
anchor_left = 0.559
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -0.072998
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer" type="VBoxContainer" parent="ui/debug/HBoxContainer"]
margin_right = 109.0
margin_bottom = 160.0

[node name="Label" type="Label" parent="ui/debug/HBoxContainer/VBoxContainer"]
margin_right = 109.0
margin_bottom = 14.0
text = "debug"

[node name="generate_shoppers" type="Button" parent="ui/debug/HBoxContainer/VBoxContainer"]
visible = false
margin_right = 131.0
margin_bottom = 20.0
text = "generate shoppers"

[node name="generate_items" type="Button" parent="ui/debug/HBoxContainer/VBoxContainer"]
margin_top = 18.0
margin_right = 109.0
margin_bottom = 38.0
focus_mode = 0
text = "generate items"

[node name="next_shopper_timer" type="Timer" parent="."]
process_mode = 0
wait_time = 2.5
one_shot = true

[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( -1, 0, -8.74228e-08, -4.37114e-08, 0.866025, 0.5, 7.57103e-08, 0.5, -0.866025, 0, 3.57772, 0 )
light_energy = 0.5
shadow_enabled = true
